home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / disk utilities / dirutil / dopus / opus5utils / arexx / winswap.dopus5 < prev   
Encoding:
Text File  |  1997-11-21  |  2.3 KB  |  73 lines

  1. /* WinSwap for Directory Opus 5.
  2.    By Leo Davidson ("Nudel", Pot-Noodle/Gods'Gift Utilities)
  3.  
  4. $VER: WinSwap.dopus5 1.3 (18.8.95)
  5.  
  6.    NOTE: This script _requires_ DOpus v5.11 or above.
  7.  
  8.    This script will swap around your source and destination listers,
  9.    like the old swap command in DOpus4.
  10.  
  11.    Obviously, in DOpus5 it is possible to simply move the two lister
  12.    windows, but somethimes this isn't desireable. For example, when they
  13.    are locked in place via the option in the pull-off menu; when you're
  14.    too lazy to move the windows; or when the two windows are positioned
  15.    such that moving them would be difficult or would make a mess.
  16.  
  17. Call as:
  18. ------------------------------------------------------------------------------
  19. ARexx    DOpus5:ARexx/WinSwap.dopus5 {Qp}
  20. ------------------------------------------------------------------------------
  21. Turn off all switches.
  22.  
  23.    v1.01 -> v1.02 - Made "PathOnly" the default behaviour and removed the
  24.                     option to copy the window dimensions (Did anyone want it?).
  25.                     Some minor tidying up.
  26.                     Now checks to make sure the DOPUS.x port exists.
  27.     v1.02 -> v1.3 - Now uses Show() instead of ShowList(). (Thanks Stoebi)
  28.                     Style Guide compliant version numbering and $VER string.
  29. */
  30.  
  31. options results
  32. options failat 99
  33. signal on syntax;signal on ioerr        /* Error trapping */
  34. parse arg DOpusPort
  35. DOpusPort = Strip(DOpusPort,"B",'" ')
  36.  
  37. If DOpusPort="" THEN Do
  38.     Say "Not correctly called from Directory Opus 5!"
  39.     Say "Load this ARexx script into an editor for more info."
  40.     EXIT
  41.     END
  42. If ~Show("P",DOpusPort) Then Do
  43.     Say DOpusPort "is not a valid port."
  44.     EXIT
  45.     End
  46. Address value DOpusPort
  47.  
  48. lister query source stem source_handle.
  49.  
  50. IF source_handle.count = 0 | source_handle.count = "SOURCE_HANDLE.COUNT" Then Do
  51.     dopus request '"You must have a SOURCE lister!" OK'
  52.     EXIT
  53.     End
  54.  
  55.  
  56. lister query dest stem dest_handle.
  57.  
  58. IF dest_handle.count = 0 | dest_handle.count = "DEST_HANDLE.COUNT" Then Do
  59.     dopus request '"You must have a DESTINATION lister!" OK'
  60.     EXIT
  61.     End
  62.  
  63. lister query source_handle.0 path
  64. source_path = RESULT
  65. lister query dest_handle.0 path
  66. dest_path = RESULT
  67.  
  68. lister read source_handle.0 dest_path
  69. lister read dest_handle.0 source_path
  70.  
  71. syntax:;ioerr:                /* In case of error, jump here */
  72. EXIT
  73.